#pragma once

#include "sfc_famicom.h"
#include <stdint.h>

// https://wiki.nesdev.org/w/index.php?title=CPU_memory_map
/*
    $FFFA-$FFFB = NMI vector
    $FFFC-$FFFD = Reset vector
    $FFFE-$FFFF = IRQ/BRK vector
*/
enum sfc_cpu_vector {
	SFC_VECTOR_NMI		= 0XFFFA,	// non-maskable interrupt
	SFC_VECTOR_RESET	= 0XFFFC,	// reset PC
	SFC_VECTOR_IRQBRK	= 0XFFFE	// interrupt request
};

uint8_t sfc_read_cpu_address(uint16_t address, const sfc_famicom_t* famicom);
void sfc_write_cpu_address(uint16_t address, uint8_t data, sfc_famicom_t* famicom);